<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js改变背景颜色</title>
</head>
<body>
	<button onclick="color('red')">设为红色</button>
	<button onclick="color('green')">设为绿色</button>
	<button onclick="color('blue')">设为蓝色</button>


	<script>
		function color(e){
			document.querySelector("body").style.background = e;
		}
	</script>
</body>
</html>